package com.jwthhealth_pub.old.subscribe;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.common.LogUtil;
import com.jwthhealth_pub.common.base.BaseActivity;
import com.jwthhealth_pub.common.view.TitleLayout;
import com.jwthhealth_pub.old.api.ApiHelper;

import static com.jwthhealth_pub.common.LogUtil.makeLogTag;

/**
 * 店面导航页面
 * Created by Administrator on 2017/9/6.
 */

public class SubscribeNavActivity extends BaseActivity {

    private static String TAG = makeLogTag(SubscribeNavActivity.class);

    @SuppressLint("SetJavaScriptEnabled")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_subscribe_nav);

        String id = getIntent().getStringExtra("shopid");
        if (id == null) return;

        WebView wv = (WebView) findViewById(R.id.wv);
        LogUtil.i(ApiHelper.BASE_NAV_URL + "/appointment/web-p/pos-map?id="+id, TAG);
        wv.loadUrl(ApiHelper.BASE_NAV_URL + "/appointment/web-p/pos-map?id="+id);
        wv.getSettings().setJavaScriptEnabled(true);
        wv.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                return false;
            }
        });
    }

    @Override
    public void title() {
        TitleLayout titleLayout = (TitleLayout) findViewById(R.id.title_layout);
        titleLayout.setTitle(getResources().getString(R.string.subscribe_location));
        titleLayout.setOnTitleLayoutListener(new TitleLayout.TitleLayoutListener() {
            @Override
            public void leftclick() {
                finish();
            }

            @Override
            public void leftTextClick() {

            }

            @Override
            public void rightclick() {

            }

            @Override
            public void rightTextClick() {

            }
        });
    }


}
